package com.ruoyi.hospital.service.member.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.hospital.domain.member.MemberSearch;
import com.ruoyi.hospital.mapper.member.MemberSearchMapper;
import com.ruoyi.hospital.service.member.IMemberSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 搜索历史Service业务层处理
 * 
 * @author wendao
 * @date 2025-06-23
 */
@Service
public class MemberSearchServiceImpl implements IMemberSearchService
{
    @Autowired
    private MemberSearchMapper memberSearchMapper;

    /**
     * 查询搜索历史
     * 
     * @param id 搜索历史主键
     * @return 搜索历史
     */
    @Override
    public MemberSearch selectMemberSearchById(Integer id)
    {
        return memberSearchMapper.selectMemberSearchById(id);
    }

    /**
     * 查询搜索历史列表
     * 
     * @param memberSearch 搜索历史
     * @return 搜索历史
     */
    @Override
    public List<MemberSearch> selectMemberSearchList(MemberSearch memberSearch)
    {
        return memberSearchMapper.selectMemberSearchList(memberSearch);
    }

    /**
     * 新增搜索历史
     * 
     * @param memberSearch 搜索历史
     * @return 结果
     */
    @Override
    public int insertMemberSearch(MemberSearch memberSearch)
    {
        memberSearch.setCreateTime(DateUtils.getNowTimeSecond());
        return memberSearchMapper.insertMemberSearch(memberSearch);
    }

    /**
     * 修改搜索历史
     * 
     * @param memberSearch 搜索历史
     * @return 结果
     */
    @Override
    public int updateMemberSearch(MemberSearch memberSearch)
    {
        return memberSearchMapper.updateMemberSearch(memberSearch);
    }

    /**
     * 批量删除搜索历史
     * 
     * @param ids 需要删除的搜索历史主键
     * @return 结果
     */
    @Override
    public int deleteMemberSearchByIds(Integer[] ids)
    {
        return memberSearchMapper.deleteMemberSearchByIds(ids);
    }

    /**
     * 删除搜索历史信息
     * 
     * @param id 搜索历史主键
     * @return 结果
     */
    @Override
    public int deleteMemberSearchById(Integer id)
    {
        return memberSearchMapper.deleteMemberSearchById(id);
    }
}
